DeriveGamemode("sandbox")

AddCSLuaFile( "cl_init.lua" ) --Tell the server that the client needs to download cl_init.lua
AddCSLuaFile( "shared.lua" ) --Tell the server that the client needs to download shared.lua
AddCSLuaFile( "cl_hud.lua" )
AddCSLuaFile( "cl_classmenu.lua" )

include( 'shared.lua' )

function GM:PlayerInitialSpawn( ply )

	RunConsoleCommand("team_menu")
	ply:Spectate()
	
end

function team_1( ply )

	ply:SetTeam(1)
	ply:Spawn()

end
 
function team_2( ply )

    ply:SetTeam(2)
	ply:Spawn()

end

function team_3( ply )

    ply:SetTeam(3)	
	ply:Spawn()
	
end

function GM:PlayerLoadout(ply)

	if ply:Team() == 1 then

		ply:Give( "weapon_physgun" )
		ply:Give( "gmod_tool" )
		ply:Give( "weapon_gravitygun" )
		
	end

	if ply:Team() == 2 then

		ply:Give( "weapon_stunstick" )
		ply:Give( "weapon_physgun" )
		ply:Give( "gmod_tool" )
		ply:Give( "weapon_gravitygun" )
	
	end
		
	if ply:Team() == 3 then

		ply:Give( "weapon_physgun" )
		ply:Give( "gmod_tool" )
		ply:Give( "weapon_gravitygun" )
		
	end
	
end

concommand.Add( "team_1", team_1 ) //Add the command to set the players team to team 1 
concommand.Add( "team_2", team_2 ) //Add the command to set the players team to team 2
concommand.Add( "team_3", team_3 ) //Add the command to set the players team to team 3  